#include <cctype>
#include <iostream>
#include <cstdlib> // for abs
using namespace std;

int gcd(int p, int q) {
    p = abs(p);
    q = abs(q);
    while (q != 0) {
        int t = q;
        q = p % q;
        p = t;
    }
    return p;
}
int x = 0;
int y = 1; // Initialize to 0/1
bool first = true;
int a = 0;
int b = 1;
int main() {
    string s;
    cin >> s;
    int i = 0;
    int term_sign = 1;
    if (i < s.size() && s[i] == '-') {
        term_sign = -1;
        i++;
    }
    first = true;
    // Parse first fraction
    a = 0;
    while (i < s.size() && isdigit(s[i])) {
        a = a * 10 + (s[i] - '0');
        i++;
    }
    if (i < s.size() && s[i] == '/') {
        i++;
        b = 0;
        while (i < s.size() && isdigit(s[i])) {
            b = b * 10 + (s[i] - '0');
            i++;
        }
    } else {
        b = 1; // If no denominator, assume /1
    }
    // Set initial
    x = term_sign * a;
    y = b;
    int g_init = gcd(x, y);
    x /= g_init;
    y /= g_init;
    first = false;
    // Now process rest
    while (i < s.size()) {
        char op = s[i];
        i++;
        term_sign = (op == '+') ? 1 : -1;
        // Parse next fraction
        a = 0;
        while (i < s.size() && isdigit(s[i])) {
            a = a * 10 + (s[i] - '0');
            i++;
        }
        if (i < s.size() && s[i] == '/') {
            i++;
            b = 0;
            while (i < s.size() && isdigit(s[i])) {
                b = b * 10 + (s[i] - '0');
                i++;
            }
        } else {
            b = 1;
        }
        // Now add/sub
        int m = x * b;
        int n = y * (term_sign * a);
        int k = y * b;
        int num = m + n;
        int g = gcd(num, k);
        x = num / g;
        y = k / g;
    }
    // Final output
    int final_g = gcd(x, y);
    x /= final_g;
    y /= final_g;
    if (y == 1 || x == 0) {
        cout << x << endl;
    } else {
        cout << x << "/" << y << endl;
    }
    return 0;
}
